﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MWTools.Client.Common.Interfaces;
using System.IO;
using System.Net;
using System.Xml;
namespace MWTools.Client.Plugins
{
    public class HttpPostSubmitter : ContentSubmitterBase
    {
        public HttpPostSubmitter()
        {

        }

        private void postXmlTransaction(string url, string xmlData)
        {
            using (WebClient wc = new WebClient())
            {
                wc.UploadString(url, xmlData);
            }
        }

        public override void SubmitContent(string serverUri, string userName, string token, string title, string content)
        {
            string href = String.Format("{0}", serverUri);

            postXmlTransaction(href, content);

        }
    }
}
